<ui:component xmlns="http://www.w3.org/1999/xhtml"  
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.prime.com.tr/ui"> 
    
<h:form id="form">

<p:panel header="Cadastro de Trabalho de Conclusão de Curso" style="width: 75%;">
<p:growl id="messages" showDetail="true" sticky="true"/>  
	  <h:panelGrid columns="2" cellpadding="2" >
	
	   		<h:outputText for="titulo" value="Título"/>  
	   		<p:inputText 
                     	id="titulo" 
                     	required="true" 
                     	label="Título" 
                     	size="82" 
                        value="#{tccBean.tcc.titulo}" /> 
             
            <h:outputText for="tema" value="Tema"/>  
	   		<p:inputText 
                     	id="tema" 
                     	required="true" 
                     	label="Tema" 
                     	size="82" 
                        value="#{tccBean.tcc.tema}" />   
                                 
            <h:outputText for="resumo" value="Resumo"/>
            <p:inputTextarea style="width:500px;height:100px;" effectDuration="400"
                     	id="resumo" 
                     	required="true" 
                     	label="Resumo" 
                        value="#{tccBean.tcc.resumo}" /> 
            
			<h:outputText for="motivacao" value="Motivação"/>
            <p:inputTextarea style="width:500px;height:100px;" effectDuration="400"
                     	id="motivacao" 
                     	required="true" 
                     	label="Motivação" 
                        value="#{tccBean.tcc.motivacao}" /> 
              
             <h:outputText for="metodologia" value="Metodologia"/>
             <p:inputTextarea style="width:500px;height:100px;" effectDuration="400"
                     	id="metodologia" 
                     	required="true" 
                     	label="Metodologia" 
                        value="#{tccBean.tcc.metodologia}" /> 
            
            <h:outputText for="dataDefesa" value="Data da Defesa "/> 
            <h:panelGroup>
            <p:calendar id="dataDefesa" 
           				value="#{tccBean.tcc.dataDefesa}" 
           				mode="popup"  
           				locale="pt_BR"
           				label="Data da Defesa"
           				autocomplete="true"
           				size="10"
           				effect="drop"
           				pattern="dd/MM/yyyy" 
           				navigator="true"
           				converter="primefacesCalendarConverter"
           				/>
           	 <h:outputText for="dataDefesa" value=" Deixe em branco, caso não queira marcar a defesa agora "/> 
            </h:panelGroup>            
            
            <h:outputLabel for="professor" value="Orientador:" />
			<p:autoComplete 
				id="professor" 
				value="#{tccBean.professorSelecionado}"
				size="50" 
                completeMethod="#{tccBean.completeProfessor}"
                var="professor" 
                itemLabel="#{professor.nome}"   
                itemValue="#{professor}" 
               	converter="professor"
                /> 
             
             <h:outputLabel for="arquivo" value="Arquivo:" />   
             <p:fileUpload id="arquivo" fileUploadListener="#{fileUploadController.handleFileUpload}"  
       			mode="advanced"  
        		update="messages"   
        		sizeLimit="1000000"  
        		allowTypes="pdf,doc,docx"
       		 	label="Selecionar"
       		 	cancelLabel="Cancelar"
        		dragDropSupport="true"     
       		 	uploadLabel="Anexar"
       		 	
        		invalidFileMessage="Arquivo Inválido"
        		
      	/>     
                              
			 <p:commandButton value=
			 "Gravar" image="ui-icon ui-icon-disk" update="messages"
                             actionListener="#{tccBean.save}"/>  
			
			<p:commandButton value="Limpar" image="ui-icon ui-icon-cancel" type="reset"/>  
	
       </h:panelGrid>
	 
    </p:panel>

  </h:form> 
 
</ui:component>